<template>
  <a-modal title="修改备注" :width="500" :visible="visible" @ok="handleModalConfirm" @cancel="handleModalCancel"
    :confirm-loading="modalLoading">
    <a-form-model ref="form" :model="form" :label-col="{ span: 2 }" :wrapper-col="{ span: 22 }">
      <a-form-model-item label="备注">
        <a-textarea v-model="form.remark"  placeholder="请输入"  />
      </a-form-model-item>

   
    </a-form-model>
  </a-modal>
</template>

<script>
import * as Ajax from '@/api/bill';
export default {
  props: {
    visible: {
      type: Boolean,
    },
    id: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      modalLoading: false,
      form: {
        remark:'',
      },
    };
  },
  watch: {
    visible(val) {
      if (val) {
        if (this.isEdit) {
          this.form = JSON.parse(JSON.stringify(this.default));
        }
      } else {
      }
    },
  },
  methods: {
    handleModalConfirm() {
   
          this.modalLoading = true;
          const params = { ...this.form, id: this.id};
          console.log(params)
       
            Ajax.updateamountRemark(params)
            .then(({ success }) => {
              if (success) {
                this.$message.success('操作成功');
                this.$emit('success');
                this.handleModalCancel();
              }
            })
            .finally(() => {
              this.modalLoading = false;
            });
          
         
    
    },
    handleModalCancel() {
      this.form = this.$options.data().form;
      this.$refs.form.resetFields();
      this.$emit('close');
    },
  },
};
</script>

<style lang="scss" scoped>
.table-wrap {
  margin-top: 20px;
  padding-top: 16px;
}

.btn-gruop {
  display: flex;
  justify-content: flex-end;
}

::v-deep .ant-form-item {
  &:last-child {
    margin-bottom: 0;
  }
}
</style>
